#pragma once
#include <vector>
#include <opencv2\opencv.hpp>
#include "HaarExtractor.h"
#include "RealAdaboost.h"
using namespace std;
using namespace cv;


class ObjectDetector
{
public:
	ObjectDetector(int width, int height);
	ObjectDetector();
	~ObjectDetector();
	void Train(vector<string> vcImagePath, vector<int> vcLabel);
	int PredictPatch(Mat image, float* conf = 0);
	vector<pair<Rect, float>> detectMultiScale(Mat image, int minW = -1, int maxW = INT_MAX, int minH = -1, int maxH = INT_MAX);
	void SaveModel(char *filename);
	void LoadModel(char *filename);
private:
	int iBasicW;
	int iBasicH;
	HaarExtractor featrueExtractor;
	RealAdaboost boost;
};

